#include<iostream>
#include<memory>
#include"smart_ptr.h"

using namespace std;







//int main()
//{
//	smart_ptr::unique_ptr<int> ap1 (new int(10));
//	smart_ptr::unique_ptr<int> ap2 = move(ap1);
//	//unique_ptr<int> ap1( new int(10));
//	//unique_ptr<int> ap2 = move(ap1);
//
//
//	return 0;
//}


class A
{
public:
	A(int a = 0)
		:_a(a)
	{
		cout << "A(int a = 0)" << endl;
	}

	~A()
	{
		cout << this;
		cout << " ~A()" << endl;
	}
	//private:

	int _a;
};
struct Node
{
	int _val;

	Node()
		:_next(nullptr)
		,_prev(nullptr)
	{}

	smart_ptr::share_ptr<Node> _next;
	smart_ptr::share_ptr<Node> _prev;

};


int main() {
   
	smart_ptr::share_ptr<Node> n1(new Node);
	smart_ptr::share_ptr<Node> n2(new Node);

	cout << n1.use_count() << endl;
	cout << n2.use_count() << endl;

	n2->_next = n1;
	n1->_prev = n2;


	cout << n1.use_count() << endl;
	cout << n2.use_count() << endl;



    return 0;
}